#ifndef CRECT_H_
#define CRECT_H_

#include "cvector2d.h"
#include "cvector.h"

/**
 * CRect - Class representing planar rectangle
 * @author Marek Rost
 * @date 15.05.2008
 */
template<typename T> class CRect : public CObject {
public:
  CRect();
  CRect(CVector2D<T> min, CVector2D<T> max);
  CRect(T left, T top, T right, T bottom);
  ~CRect() {
  }
  T getLeft() const;
  T getTop() const;
  T getRight() const;
  T getBottom() const;
  T getWidth() const;
  T getHeight() const;
  CVector2D<T> getMin() const;
  CVector2D<T> getMax() const;
  void setMin(CVector2D<T> min);
  void setMax(CVector2D<T> max);
  bool isPointInRect(const CVector2D<T> &p);
  string toString() const;
  static string getClassName() {
    return "CRect";
  }
private:
  CVector2D<T> min, max;
};

#endif
